﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="clr-namespace:DeepForest.Phone.Assets.Controls"
    xmlns:tools="clr-namespace:DeepForest.Phone.Assets.Tools"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d">

    <DataTemplate x:Key="NotificationActionDefaultTemplate">
        <TextBlock Text="{Binding Content}" />
    </DataTemplate>
    
    <Style TargetType="controls:NotificationBoxItem">
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
        <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
        <Setter Property="Padding" Value="10,3,10,5"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:NotificationBoxItem">
                    <Grid Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver"/>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="0" Margin="{StaticResource PhoneTouchTargetOverhang}">
                            <ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>    
    
    <Style TargetType="controls:NotificationBox">
        <Setter Property="ItemTemplate" Value="{StaticResource NotificationActionDefaultTemplate}" />
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}" />
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeNormal}" />
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}" />
        <Setter Property="Background" Value="#99000000" />
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>               
        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:NotificationBox">
                    <Border Background="#99000000" d:DesignWidth="312" d:DesignHeight="464">
                        <Border x:Name="border" Background="#FF1F1F1F" VerticalAlignment="Top">
                            <Grid Margin="24,40,24,0">
                        		<Grid.RowDefinitions>
                        			<RowDefinition Height="60"/>
                        			<RowDefinition Height="Auto" />
                        			<RowDefinition/>
                        			<RowDefinition Height="Auto" />
                        		</Grid.RowDefinitions>
                                
                        		<TextBlock Text="{TemplateBinding Title}" VerticalAlignment="Center" Margin="0,0,0,2" FontSize="32" />
                        		<TextBlock Text="{TemplateBinding Message}" TextWrapping="Wrap" Grid.Row="1" Margin="0,2,0,2" FontSize="22" Foreground="#FFDDDDDD" />
                                
                                <ItemsPresenter Grid.Row="2" Margin="0,2,0,8" />
                                
                        		<CheckBox IsChecked="{Binding ShowAgainOption, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                        			Visibility="{TemplateBinding ShowAgainVisibility}"
                        			Content="{TemplateBinding ShowAgainText}"
                        			Grid.Row="3"
                        			VerticalAlignment="Center"
                        			HorizontalAlignment="Left" />
                                
                        	</Grid>
                        </Border>                        
                    </Border>
                </ControlTemplate>
            </Setter.Value>            
        </Setter>
    </Style>

</ResourceDictionary>
